# -*- conding:UTF-8 -*-

'''
@ Project: P8 hw register_login
@ File: tasks.py
@ Author: 罗婷
@ Date：2022/6/16 18:45

'''
from common.celery.celery_main import app
from ronglian_sms_sdk import SmsSDK


accId = '8a216da8804ba8a5018064a39933069b'
accToken = '09880a5e3fc94046b3cc147e240ad169'
appId = '8a216da8804ba8a5018064a39a3706a2'

@app.task
def send_smscode(mobile, sms, expire=60):
    sdk = SmsSDK(appId, accToken, appId)
    tid = '1'
    mobile = f'{mobile}'
    datas = (f'{sms}', f'{expire}')
    ret = sdk.sendMessage(tid, mobile, datas)
    if ret:
        return True
    else:
        return False
















